﻿using System.Collections.ObjectModel;

namespace WpfValueConverter
{
    internal class MainWindowViewModel : ObservableObject
    {
        private ObservableCollection<Student> students;

        public ObservableCollection<Student> Students
        {
            get { return students; }
            set
            {
                students = value;
                RaisePropertyChanged();
            }
        }

        public MainWindowViewModel()
        {
            students = new ObservableCollection<Student>();
            Students.Add(new Student
            {
                Name = "张三",
                Chinese = 99,
                Math = 80,
                English = 98
            });

            Students.Add(new Student
            {
                Name = "李四",
                Chinese = 69,
                Math = 99,
                English = 65
            });

            Students.Add(new Student
            {
                Name = "王五",
                Chinese = 89,
                Math = 100,
                English = 50
            });
        }
    }
}
